package com.jiahao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

import java.io.UnsupportedEncodingException;

/*
 *主程序类
 * 用于引导SpringBoot的启动
 * @SpringBootApplication：声明这是一个SpringBoot类
 */
@SpringBootApplication
public class CheckUserApplication {

    @Autowired
    private RestTemplateBuilder builder;

    @Bean
    public RestTemplate restTemplate(){
        return builder.build();
    }

    public static void main(String[] args) throws UnsupportedEncodingException {

        SpringApplication.run(CheckUserApplication.class, args);

    }
}
